package com.leyou.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.item.entity.Category;
import org.apache.ibatis.annotations.Select;

import javax.websocket.server.PathParam;
import java.util.List;

public interface CategoryMapper extends BaseMapper<Category> {
    @Select("select * from tb_category where parent_id = #{pid} ")
    List<Category> findCategoryByPid(@PathParam("pid") Long pid);

    @Select("select * from tb_category where id in (select category_id from tb_category_brand where brand_id = #{id})")
    List<Category> queryByBrandId(@PathParam("id") Integer id);


}
